/* 基础样式 */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500&display=swap");

body {
  font-family: "Inter", "Kanit", sans-serif;
  display: grid;
  place-items: center;
  height: 100vh;
  background-size: 24px 24px;
  background-image: linear-gradient(to right, #e7e9e7 1px, transparent 1px),
    linear-gradient(to bottom, #e7e9e7 1px, transparent 1px);
  background-color: #eff1ef;
  color: #1d211c;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 网格背景 */
body::before {
  content: "";
  position: fixed;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  background-size: 96px 96px;
  background-image: linear-gradient(to right, #dfe2df 1px, transparent 1px),
    linear-gradient(to bottom, #dfe2df 1px, transparent 1px);
}

/* 文本样式 */
h1, p {
  animation: translate-y-100 300ms cubic-bezier(0.165, 0.84, 0.44, 1.2) forwards;
  opacity: 0;
}

h1 {
  margin: 0 0 0.5rem 0;
  font-size: 24px;
  animation-delay: 1100ms;
}

p {
  margin-top: 0;
  font-size: 13px;
  color: #60655f;
  animation-delay: 1150ms;
}

/* 按钮样式 */
button {
  position: relative;
  height: 32px;
  width: 100%;
  border-radius: 5px;
  line-height: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #46a758;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset,
    0 1px 3px 0 rgba(24, 25, 22, 0.1), 0 1px 2px -1px rgba(24, 25, 22, 0.1);
  border: 1px solid #2a7e3b;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: transform 200ms cubic-bezier(0.165, -0.84, 0.44, 2),
    opacity 200ms ease, background-color 100ms ease;
  cursor: pointer;
}

button:hover {
  background: #2a7e3b;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

button:active {
  transform: scale(0.98);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04) inset;
}

button.secondary {
  color: #181916;
  background: white;
  border: 1px solid #d9d9d6;
}

button.secondary:hover {
  background: #f8f8f6;
}

/* 卡片样式 */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 448px;
  padding: 32px;
  background-color: #ffffff;
  border-radius: 5px;
  box-sizing: border-box;
}

.card:before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.01), 0 2px 4px rgba(0, 0, 0, 0.04);
  border-radius: 5px;
  clip-path: inset(0px -4px 0px -4px);
}

/* Success页面特定样式 */
.card:nth-of-type(3):before {
  clip-path: inset(0px -4px -4px -4px);
}

.card:first-of-type {
  animation: translate-y-100 500ms 1000ms cubic-bezier(0.19, 1, 0.22, 1.2) forwards;
  opacity: 0;
  z-index: 0;
}

.card .icon {
  width: 64px;
  height: 64px;
  border: 2px solid #ffffff;
  border-radius: 9999px;
  background: linear-gradient(to top, #f2f2f280, #e0e0e080);
  box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.06) inset;
  display: grid;
  place-content: center;
  margin-bottom: 1rem;
}

.card .icon:before {
  content: "\2713";
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 9999px;
  background-color: #ffffff;
  box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.03);
  font-family: "arial";
  font-size: 32px;
  color: #46a758;
}

.card:not(:first-of-type) {
  transform-origin: top;
  animation: unfold 500ms 1700ms cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
  -webkit-transform: perspective(500px) rotateX(-0.25turn);
  z-index: 1;
  opacity: 0.9;
}

.card:nth-of-type(3) {
  animation-delay: 1950ms;
  animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 1.4);
  z-index: 2;
}

.card:not(:first-of-type):after {
  position: absolute;
  top: -0.5px;
  left: 1%;
  content: "";
  width: 98%;
  height: 1px;
  border-top: 1px #d7dad7 dashed;
}

/* 订单信息列表样式 */
ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  width: 100%;
}

ul > li {
  width: 100%;
  display: flex;
  justify-content: space-between;
}

ul > li span {
  font-size: 12px;
  font-weight: 500;
  color: #212121;
}

ul > li span:first-of-type {
  color: #757575;
}

/* CTA行样式 */
.cta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  animation: translate-y-100 600ms 2200ms cubic-bezier(0.19, 1, 0.22, 1) forwards;
  opacity: 0;
}

/* 动画效果 */
.fade-in { 
    opacity: 0; 
    transform: translateY(15px); 
    transition: all 0.6s ease-out; 
}

.fade-in.active { 
    opacity: 1; 
    transform: translateY(0); 
}

/* 加载动画 */
.qr-loading {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 0, 0, 0.1);
    border-top-color: #22c55e;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: block;
    margin: auto;
}

/* 自定义光标 */
#cursor {
    position: fixed;
    width: 16px;
    height: 16px;
    background: #000;
    border-radius: 8px;
    opacity: 0.25;
    z-index: 10086;
    pointer-events: none;
    transition: 0.2s ease-in-out;
    transition-property: background, opacity, transform;
}

#cursor.hidden {
    opacity: 0;
}

#cursor.hover {
    opacity: 0.1;
    transform: scale(2.5);
}

#cursor.active {
    opacity: 0.5;
    transform: scale(0.5);
}

/* 选中状态 */
.selected {
    opacity: 1;
    transform: scale(0.98);
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.25);
    font-weight: bold;
    position: relative;
}

.selected::after {
    content: '✓';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
}

/* 支付按钮 */
#wxpay-btn, #alipay-btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* 动画关键帧 */
@keyframes translate-y-100 {
  0% {
    transform: scale(0.9) translateY(0.5rem);
  }
  100% {
    opacity: 1;
  }
}

@keyframes unfold {
  to {
    transform: none;
    opacity: 1;
  }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
